<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<sfa:mainTitle></sfa:mainTitle>
<%@ include file="/common/meta.jsp"%>
<script type="text/javascript">

function verify(id){
	var meetingStatus = $("#"+id).attr("meetingStatus");
	var data = {
		meetingStatus:meetingStatus,
		saleMeetingId:id
	}
	$.ajax({
		url:'${path}/manage/meetings/index/verify',
		dataType:'json',
		data:data,
		success:function(result){
			if(result.returnStatus == 'y'){
				$("#"+id).html('<span>取消审核</span>');
				$("#"+id).attr("meetingStatus",'APPLYSTATUS_3');
				$("#"+id+"_001").html('<span>通过审核</span>');
			}else{
				$("#"+id).html('<span>审核</span>');
				$("#"+id).attr("meetingStatus",'APPLYSTATUS_4');
				$("#"+id+"_001").html('<span>未通过审核</span>');
			}
		}
	});
}
</script>
		<script type="text/javascript">
$(function() {
	$(".deleteMeeting").click(function() {
		var saleMeetingId = $(this).attr("saleMeetingId");
		//alert(saleMeetingId);
			var url = "${path}/manage/meetings/index/delete/" + saleMeetingId;
			art.dialog( {
				lock : true,
				content : '确定要删除吗?',
				ok : function() {
					art.dialog( {
						id : "loading",
						lock : true,
						drag : false,
						resize : false,
						title : "正在删除...",
						time : 5
					});
					$.post(url, null, function(result) {
						art.dialog( {
							id : 'loading'
						}).close();//关闭等待框
							if (result.isDel) {
								art.dialog( {
									icon : "succeed",
									content : "删除成功!",
									lock : true,
									ok : function() {
										location.reload();
									}
								});
							} else {
								art.dialog( {
									icon : "error",
									content : "删除失败!",
									lock : true,
									ok : true
								});
							}

						});

					return true;
				},
				cancelVal : '关闭',
				cancel : true
			//为true等价于function(){}
					});

		});

});

function doQuery() {
	document.form1.action = "${path}/manage/meetings/index/getmeetings";
	document.form1.submit();
}

$(function(){
	$("#fullScreen").click(function(){
		fullScreen.FullScreen("mylist"); 
	});
})

</script>

	</head>
	<body id="master">
		<sfa:mainHeader></sfa:mainHeader>
		
		
		<div class="webpart3 contentarea">
				<div class="webpart-head">
					<div class="webpart-head-item">
						管理早会
						<div class="tools-btn">
							<a href="####" id="fullScreen"><span> <img
										src="${path}/statics/images/qp.gif"
										style="margin-right: 4px; margin-bottom: -3px;" />全屏</span> </a>
							 
						</div>
					</div>
				</div>
				<div class="webpart-main">
					<div class="webpart-main-item" style="padding-top: 12px;">
                     <!----------- 查询信息 ------------------>
					<div class="search">
						<form name="form1" method="post">
                            <table cellspacing="0" cellpadding="0">
                                <tbody><tr>
                                    <th>
                                        	早会开始：
                                    </th>
                                    <td>
                                        <input id="beginCreateDate" name="beginCreateDate" type="text"
										onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
										class="Wdate input-txt" readOnly="true"
										value="${beginCreateDate}" />
                                    </td>
                                    <th>
                                        	早会结束:
                                    </th>
                                    <td>
                                        <input id="endCreateDate" name="endCreateDate" type="text"
										onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
										class="Wdate input-txt" readOnly="true"
										value="${endCreateDate}" />
                                    </td>
                                    
                                    <th>
                                      	          早会标题：
                                    </th>
                                    <td>
                                        <input type="text" class="input-txt" id="meetingTitle"
										name="meetingTitle" value="${meetingTitle}" />
                                    </td>
                                    <td>
                                        <a class="linkbtn" href="javascript:" onclick="doQuery()"><span>查 询</span></a>
                                    </td>
								</tr>
								<tr>
								
									<th>
                                      	        早会内容：
                                    </th>
                                    <td>
                                        <input type="text" class="input-txt" id="meetingContent"
										name="meetingContent" value="${meetingContent}" />
                                    </td>
									<th>
                                      	        审核状态：
                                    </th>
                                    <td>
                                        <sfa:dic showType="select" kindNo="APPLYSTATUS" def="ALL:全部;"
										attr="class='selectbox' style='height: 25px; width: 123px;'" name="meetingStatus" id="meetingStatus"
										code="${meetingStatus}">
										</sfa:dic>
                                    </td>
									<th>
                                      	        主持人：
                                    </th>
                                    <td>
                                        <input type="text" class="input-txt" id="meetingMaster"
										name="meetingMaster" value="${meetingMaster}" />
                                    </td>
                                     <td>
                                        <a class="linkbtn" href="javascript:" onclick="location.href='${path}/manage/meetings/index/getmeetings';"><span>清 空</span></a>
                                    </td>
                                </tr>
                            </tbody></table>
                            </form>
                        </div>
					<!-- 查詢列表 -->
					<div id="mylist">
					<table class="dg_borderstyle trStyleTable" cellspacing="0" cellpadding="0" style="margin-top: 15px;text-align: center;">
					<tbody>
						<tr class="tabheader">
						<th>
								<span>序号</span>
							</th>
							<th>
								<span>早会标题</span>
							</th>
							<th>
								<span>主持人</span>
							</th>
							<th>
								<span>开始时间</span>
							</th>
							<th>
								<span>结束时间</span>
							</th>
							<th>
								<span>审核状态</span>
							</th>
							<th>
								<span>操作</span>
							</th>
						</tr>
						<c:forEach items="${pagination.resultList}" var="meeting" varStatus="ind">
						
							<tr class="gray datarow">
							  <td align="center">${(pagination.page-1)*10+(ind.index+1)}</td> 
								<td style="text-align: left;" >
								 <div style="width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
									<a
										href="${path}/manage/meetings/index/view?saleMeetingId=${meeting.saleMeetingId}" title="${meeting.meetingTitle }">${meeting.meetingTitle }</a>
									</div>
								</td>

								<td>
									<span>${meeting.masterName}</span>
								</td>
								<td>
									<span><fmt:formatDate value="${meeting.startDate}"
											pattern="yyyy-MM-dd HH:mm:ss" />
									</span>
								</td>
								<td>
									<span><fmt:formatDate value="${meeting.endDate}"
											pattern="yyyy-MM-dd HH:mm:ss" />
									</span>
								</td>
								<td id="${meeting.saleMeetingId}_001" >
									<span><sfa:dic showType="value" code="${meeting.meetingStatus}"></sfa:dic>
									</span>
								</td>
								<td >
									<a
										href="${path}/manage/meetings/index/view?saleMeetingId=${meeting.saleMeetingId}">预览</a>
									<span class="v_line">| </span>
									
									<c:set value="${meeting.meetingStatus}" var="meetingStatus"></c:set>
									
									<c:if test="${meetingStatus != 'APPLYSTATUS_3'}">
										<a onclick = "verify('${meeting.saleMeetingId}')" href="#" meetingStatus="${meeting.meetingStatus}" id="${meeting.saleMeetingId}"><span>审核</span></a>
									</c:if>
									<c:if test="${meetingStatus == 'APPLYSTATUS_3'}">
										<a onclick = "verify('${meeting.saleMeetingId}')" href="#" meetingStatus="${meeting.meetingStatus}" id="${meeting.saleMeetingId}"><span>取消审核</span></a>
									</c:if>
									<span class="v_line">| </span>
									<a href="javascript:void(0);" class="deleteMeeting"
										saleMeetingId="${meeting.saleMeetingId}">删除</a>
								</td>
							</tr>
						</c:forEach>
				</table>
			
			
			<!----------- 翻页导航 ------------------>
                        <div class="dg_pagerstyle">
                            <div class="pageinfo">
                                第${page }页 | 共${pagination.totalPages }页/${pagination.totalRows }条记录
                            </div>
                            <div class="pagebtn">
                                ${pagination.multiPage}&nbsp;
                            </div>
                        </div>
                
            </div>
            </div>
            </div>
            <div class="webpart-foot">
                    <div class="webpart-foot-item">
                    </div>
                </div>
            </div>

			<sfa:mainFooter></sfa:mainFooter>

	</body>
</html>



